{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "view-in-github"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/TechnoDexx/DataScience/blob/main/%D0%9A%D0%BE%D0%BF%D0%B8%D1%8F_%D0%B1%D0%BB%D0%BE%D0%BA%D0%BD%D0%BE%D1%82%D0%B0_%22%D0%9F%D0%BE%D0%B3%D1%80%D1%83%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B2_DS%2C_%D0%B4%D0%B5%D0%BD%D1%8C_2_v3_ipynb%22.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "idQEkRHdu3ai"
      },
      "source": [
        "![Снимок экрана 2022-10-25 в 18.20.37.png]()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "k2Fc7paBfexg"
      },
      "source": [
        "# 🔎 Знакомство с анализом данных"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "c3gy0DRPfexh"
      },
      "source": [
        "Вспоминаем про переменные :)\n",
        "\n",
        "Главный объект в аналитике - опять данные. С точки зрения python файл с информацией помещается в переменную, мы называем её определённым именем (в наших примерах будет data) и далее можем с ней работать при помощи средств программирования. Для компьютера это, фактически, адрес в физической памяти на диске, по которому эти данные хранятся.\n",
        "\n",
        "Для продвинутой обработки данных при помощи python существуют библиотеки - это известный и уже реализованный набор методов и функций. Т.е. для каких-то стандартных операций и преобразований самостоятельно код можно не писать, а воспользоваться его готовой (и эффективной) реализацией из библиотеке.\n",
        "\n",
        "Первым делом подключим необходимые библиотеки и \"положим\" наш файл с данными в переменную data:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "collapsed": true,
        "id": "Qrf8aR2yfexi"
      },
      "outputs": [],
      "source": [
        "# подключение необходимых библиотек\n",
        "import pandas as pd"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 2,
      "metadata": {
        "collapsed": true,
        "id": "bq-rjYRvfexl"
      },
      "outputs": [],
      "source": [
        "# считываем данные по ссылке\n",
        "data = pd.read_csv('https://raw.githubusercontent.com/MariaZharova/3-day-intensive/main/Mall_Customers.csv', sep = ',')"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "lJwR7ZH4kiKZ"
      },
      "source": [
        "Описание колонок в файле:\n",
        "\n",
        "- CustomerID - id клиента\n",
        "-\tGenre - пол\n",
        "- Age - возраст\n",
        "-\tIncome - сумма покупки\n",
        "-\tScore - оставленная оценка"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Pofi6vqefexn"
      },
      "source": [
        "Теперь файл хранится в data, с ним можно выполнять различные действия (готовые из библиотеки). Эти \"действия\" называются ***методами***, пишутся через точку после data и обычно имеют логичное соответствующее название на английском.\n",
        "\n",
        "Давайте посмотрим на основные из них:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 206
        },
        "collapsed": true,
        "id": "BHCqbvikfexo",
        "outputId": "5183b736-3e88-4468-f67e-af159e150488"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>CustomerID</th>\n",
              "      <th>Genre</th>\n",
              "      <th>Age</th>\n",
              "      <th>Income</th>\n",
              "      <th>Score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>Male</td>\n",
              "      <td>19</td>\n",
              "      <td>15</td>\n",
              "      <td>39</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "      <td>Male</td>\n",
              "      <td>21</td>\n",
              "      <td>15</td>\n",
              "      <td>81</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>3</td>\n",
              "      <td>Female</td>\n",
              "      <td>20</td>\n",
              "      <td>16</td>\n",
              "      <td>6</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4</td>\n",
              "      <td>Female</td>\n",
              "      <td>23</td>\n",
              "      <td>16</td>\n",
              "      <td>77</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>5</td>\n",
              "      <td>Female</td>\n",
              "      <td>31</td>\n",
              "      <td>17</td>\n",
              "      <td>40</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   CustomerID   Genre  Age  Income  Score\n",
              "0           1    Male   19      15     39\n",
              "1           2    Male   21      15     81\n",
              "2           3  Female   20      16      6\n",
              "3           4  Female   23      16     77\n",
              "4           5  Female   31      17     40"
            ]
          },
          "execution_count": 3,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "# метод head показывает заданное количество первых строк (head - голова)\n",
        "data.head(5)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "collapsed": true,
        "id": "kd7hZiuIfexp",
        "outputId": "d819a268-2593-46a9-ceb3-c367fbf88949"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "Index(['CustomerID', 'Genre', 'Age', 'Income', 'Score'], dtype='object')"
            ]
          },
          "execution_count": 4,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "# посмотрим колонки в нашей файле\n",
        "data.columns"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 5,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "collapsed": true,
        "id": "E-nL4d0nfexq",
        "outputId": "3be00a2e-c32f-4c10-fcf6-77665177808a"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "0    15\n",
              "1    15\n",
              "2    16\n",
              "3    16\n",
              "4    17\n",
              "Name: Income, dtype: int64"
            ]
          },
          "execution_count": 5,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "# можно также обращаться к определёным колонкам, пример для Income\n",
        "data.Income.head(5)\n",
        "# кстати это ещё пример последовательного применения нескольких методов - сначала\n",
        "# берём нужную колонку, а затем head() выводит из неё только первые 5 строк"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 6,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "collapsed": true,
        "id": "G3auYe70fexs",
        "outputId": "0ab12c21-82a4-44cc-b7de-2b6e2fad4827"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "(200, 5)"
            ]
          },
          "execution_count": 6,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "# а этот метод покажет размерность файла\n",
        "data.shape"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 423
        },
        "collapsed": true,
        "id": "vHpKeWSRfext",
        "outputId": "6cc410f2-0ec8-45f9-cb15-935e1e78139d"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>CustomerID</th>\n",
              "      <th>Genre</th>\n",
              "      <th>Age</th>\n",
              "      <th>Income</th>\n",
              "      <th>Score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>33</th>\n",
              "      <td>34</td>\n",
              "      <td>Male</td>\n",
              "      <td>18</td>\n",
              "      <td>33</td>\n",
              "      <td>92</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>65</th>\n",
              "      <td>66</td>\n",
              "      <td>Male</td>\n",
              "      <td>18</td>\n",
              "      <td>48</td>\n",
              "      <td>59</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>91</th>\n",
              "      <td>92</td>\n",
              "      <td>Male</td>\n",
              "      <td>18</td>\n",
              "      <td>59</td>\n",
              "      <td>41</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>114</th>\n",
              "      <td>115</td>\n",
              "      <td>Female</td>\n",
              "      <td>18</td>\n",
              "      <td>65</td>\n",
              "      <td>48</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>Male</td>\n",
              "      <td>19</td>\n",
              "      <td>15</td>\n",
              "      <td>39</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>90</th>\n",
              "      <td>91</td>\n",
              "      <td>Female</td>\n",
              "      <td>68</td>\n",
              "      <td>59</td>\n",
              "      <td>55</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>108</th>\n",
              "      <td>109</td>\n",
              "      <td>Male</td>\n",
              "      <td>68</td>\n",
              "      <td>63</td>\n",
              "      <td>43</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>57</th>\n",
              "      <td>58</td>\n",
              "      <td>Male</td>\n",
              "      <td>69</td>\n",
              "      <td>44</td>\n",
              "      <td>46</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>60</th>\n",
              "      <td>61</td>\n",
              "      <td>Male</td>\n",
              "      <td>70</td>\n",
              "      <td>46</td>\n",
              "      <td>56</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>70</th>\n",
              "      <td>71</td>\n",
              "      <td>Male</td>\n",
              "      <td>70</td>\n",
              "      <td>49</td>\n",
              "      <td>55</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>200 rows × 5 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "     CustomerID   Genre  Age  Income  Score\n",
              "33           34    Male   18      33     92\n",
              "65           66    Male   18      48     59\n",
              "91           92    Male   18      59     41\n",
              "114         115  Female   18      65     48\n",
              "0             1    Male   19      15     39\n",
              "..          ...     ...  ...     ...    ...\n",
              "90           91  Female   68      59     55\n",
              "108         109    Male   68      63     43\n",
              "57           58    Male   69      44     46\n",
              "60           61    Male   70      46     56\n",
              "70           71    Male   70      49     55\n",
              "\n",
              "[200 rows x 5 columns]"
            ]
          },
          "execution_count": 7,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "# отсортируем по колонке возраста в порядке убывания\n",
        "# это пример более сложного метода - теперь в скобках можно указать дополнительные параметры\n",
        "# здесь можем указать колонку, по которой сортируем (возраст Age)\n",
        "# и порядок возрастания/убывания (ascening: True/False)\n",
        "data.sort_values(['Age', 'Income'], ascending=True)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 8,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 466
        },
        "id": "dl1ryZjifexu",
        "outputId": "c694f351-699d-416d-e08c-7100555f4ed2"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<Axes: xlabel='Age', ylabel='Income'>"
            ]
          },
          "execution_count": 8,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjsAAAGwCAYAAABPSaTdAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/OQEPoAAAACXBIWXMAAA9hAAAPYQGoP6dpAABIfElEQVR4nO3de3hUxd0H8O+ShHDNBnJPJRohAqJoJIIhQAXySKlvkUq98FKhirW23KVWaEWLL4r3KrwI1VKQpwpoKxRtxSJCkBi5SbzhC0EiYCEkXJKQREIg5/3DZmWT7O7Z3TnnzMx+P8+zzwPnbM7Ozsw5+zszc2ZchmEYICIiItJUG6cTQERERGQlBjtERESkNQY7REREpDUGO0RERKQ1BjtERESkNQY7REREpDUGO0RERKS1aKcTIIPGxkYcOXIEnTt3hsvlcjo5REREZIJhGDh9+jTS09PRpo3v9hsGOwCOHDmCbt26OZ0MIiIiCsHhw4dx0UUX+dzPYAdA586dAXybWXFxcQ6nhoiIiMyorq5Gt27dPL/jvjDYATxdV3FxcQx2iIiIFBNoCAoHKBMREZHWGOwQERGR1hwNdrZs2YIf/ehHSE9Ph8vlwtq1a32+995774XL5cJzzz3ntf3kyZMYN24c4uLiEB8fj4kTJ6KmpsbahBMREZEyHA12amtrcdVVV2HRokV+37dmzRp8+OGHSE9Pb7Fv3Lhx+Pzzz7Fhwwa89dZb2LJlC+655x6rkkxERESKcXSA8siRIzFy5Ei/7/n3v/+NKVOm4J133sGNN97ote+LL77A+vXrsWPHDuTk5AAAFi5ciB/+8Id4+umnWw2OiIiIKLJIPWansbERd9xxB+6//3706dOnxf6ioiLEx8d7Ah0AyM/PR5s2bbBt2zafx62vr0d1dbXXi4iIiPQkdbDzxBNPIDo6GlOnTm11f1lZGZKTk722RUdHo2vXrigrK/N53Pnz58PtdntenFCQiIhIX9IGO7t27cLzzz+P5cuXC1/CYfbs2aiqqvK8Dh8+LPT4REREJA9pg533338f5eXlyMjIQHR0NKKjo3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+c9oaqQuLS3FT37yE4wePRoff/wxfvGLX+B3v/ud199/+eWX+MEPfoAxY8bgk08+werVq7F161ZMnjzZia9DRBZjNxYRKScvLw+33norpk2bhnPnziEtLQ2vv/46rr/+esyaNQv/+Mc/8Omnn3re/+CDD+LRRx/FqVOnEB8fj7vvvhtRUVH44x//6HnP1q1b8f3vfx+1tbVo166dE1+LiCzClh0iUsrevXuxfft2jB07FgAQHR2N2267DUuXLvXsv/baa73+pn///l7///jjj7F8+XJ06tTJ8xoxYgQaGxtRWlpqzxchIttEO50AIqJgLF26FOfOnfMakGwYBmJjY/G///u/po5RU1ODX/ziF5g6dWqLfRkZGcLSSkRyYLBDRMo4d+4cVqxYgWeeeQY33HCD177Ro0dj5cqV6NmzJ/75z3967duxY4fX/6+55hrs2bMHPXr0sDzNROQ8jtkhImWsXbsWt912G8rLy+F2u732PfDAA3jvvffw2muvoWfPnpgxYwYmTpyI4uJizJw5E19//TUqKyvhdrvxySef4LrrrsNdd92Fu+++Gx07dsSePXuwYcMG061DRKQOjtkhImUsXboU+fn5LQIdABgzZgx27tyJ06dP469//SveeOMN9O3bF4sXL/Y8jRUbGwsA6Nu3LwoKCrBv3z4MHjwY2dnZeOihhzhXD5Gm2LJDRNp79NFHsWTJEhw+fNjppBCRAzhmh4i088ILL+Daa69FQkICCgsL8dRTT3EOHaIIxmCHiLRTUlKCefPm4eTJk8jIyMDMmTMxe/Zsp5NFRA5hNxYRERFpjQOUiYiISGsMdoiIiEhrDHaIiIhIawx2iIiISGsMdoiIiEhrDHaIiIhIawx2iIiISGsMdoiIiEhr/w/7nTptCkK6NgAAAABJRU5ErkJggg==",
            "text/plain": [
              "<Figure size 640x480 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "# нарисуем зависимость выжваемости от возраста\n",
        "# по горизонтальной оси x указываем возраст\n",
        "# по вертикальной y выживаемость\n",
        "data.plot.scatter(x='Age', y='Income')"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ANdszLLvyjbW"
      },
      "source": [
        "# 🔎 Что такое машинное обучение и глубокое обучение?\n",
        "\n",
        "### ⛳ Machine learning и Deep learning – это 2 подмножества искусственного интеллекта:\n",
        "\n",
        "- ML связан с созданием алгоритмов, которые могут изменять себя без вмешательства человека для получения желаемого результата - путем подачи себя через структурированные данные.\n",
        "- В DL алгоритмы создаются и функционируют аналогично ML, но устроены они более сложно - существует множество уровней этих алгоритмов, каждый из которых обеспечивает различную интерпретацию данных, которые он передает. Такая сеть алгоритмов называется искусственными нейронными сетями. Простыми словами, это напоминает нейронные связи, которые имеются в человеческом мозге.\n",
        "\n",
        "\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "wk-iSawxyjSw"
      },
      "source": [
        "### ⛳ Более практическое объяснение работы:\n",
        "\n",
        "- Имеем табличные данные: назовём колонки-характеристики $x_1,\\; x_2\\;, ..., x_N$, колонку-ответ $Y$ (на примере того же файла с данными клиентов магазина):"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 9,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 269
        },
        "id": "ijd-pndPlpgc",
        "outputId": "788b8f6b-025b-4335-856f-9a023b001b68"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>CustomerID</th>\n",
              "      <th>Genre</th>\n",
              "      <th>Age</th>\n",
              "      <th>Income</th>\n",
              "      <th>Score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>Male</td>\n",
              "      <td>19</td>\n",
              "      <td>15</td>\n",
              "      <td>39</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "      <td>Male</td>\n",
              "      <td>21</td>\n",
              "      <td>15</td>\n",
              "      <td>81</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>3</td>\n",
              "      <td>Female</td>\n",
              "      <td>20</td>\n",
              "      <td>16</td>\n",
              "      <td>6</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4</td>\n",
              "      <td>Female</td>\n",
              "      <td>23</td>\n",
              "      <td>16</td>\n",
              "      <td>77</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>5</td>\n",
              "      <td>Female</td>\n",
              "      <td>31</td>\n",
              "      <td>17</td>\n",
              "      <td>40</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>6</td>\n",
              "      <td>Female</td>\n",
              "      <td>22</td>\n",
              "      <td>17</td>\n",
              "      <td>76</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>7</td>\n",
              "      <td>Female</td>\n",
              "      <td>35</td>\n",
              "      <td>18</td>\n",
              "      <td>6</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   CustomerID   Genre  Age  Income  Score\n",
              "0           1    Male   19      15     39\n",
              "1           2    Male   21      15     81\n",
              "2           3  Female   20      16      6\n",
              "3           4  Female   23      16     77\n",
              "4           5  Female   31      17     40\n",
              "5           6  Female   22      17     76\n",
              "6           7  Female   35      18      6"
            ]
          },
          "execution_count": 9,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "# в качестве таргета возьмём столбец Score\n",
        "# т.е. будем предсказывать оценку пользователя по его описанию\n",
        "data.head(7)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "myjYdMzDKvK6"
      },
      "source": [
        "- Цель: написать алгоритм (модель машинного обучения), который бы как можно точнее предсказывал Target, видя только столбцы-характеристики. Например, очень популярный подход - подобрать такие коэффициенты $a_1, a_2, ..., a_N$, чтобы сумма $x_1\\cdot a_1 + ... + x_N\\cdot a_N$ максимально точно приближала истинный ответ Target (пытаемся вывести закономерности, понять, какие столбцы влияют на итоговый ответ больше всего)."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "k7ESGhHxFZzt"
      },
      "source": [
        "- Для решения таких задач предсказания используются широко известные алгоритмы (модели), которые реализованы в библиотеках Python (например, sklearn). Перейдём к коду и посмотрим на них :)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 10,
      "metadata": {
        "collapsed": true,
        "id": "qBbQ8sxVRVT7"
      },
      "outputs": [],
      "source": [
        "# выгрузка ещё части нужных библиотек\n",
        "\n",
        "# для обработки файлов\n",
        "import pandas as pd\n",
        "import numpy as np\n",
        "\n",
        "# для машинного обучения\n",
        "import sklearn\n",
        "from sklearn.linear_model import LinearRegression\n",
        "from sklearn.ensemble import GradientBoostingRegressor\n",
        "from sklearn.model_selection import train_test_split\n",
        "from sklearn.model_selection import cross_val_score\n",
        "from sklearn.metrics import accuracy_score\n",
        "from sklearn import metrics"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 11,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 206
        },
        "id": "-U3BxpI2Nsba",
        "outputId": "5ab182f6-13a8-49ed-c38e-08c8cd1315bb"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>CustomerID</th>\n",
              "      <th>Genre</th>\n",
              "      <th>Age</th>\n",
              "      <th>Income</th>\n",
              "      <th>Score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>Male</td>\n",
              "      <td>19</td>\n",
              "      <td>15</td>\n",
              "      <td>39</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "      <td>Male</td>\n",
              "      <td>21</td>\n",
              "      <td>15</td>\n",
              "      <td>81</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>3</td>\n",
              "      <td>Female</td>\n",
              "      <td>20</td>\n",
              "      <td>16</td>\n",
              "      <td>6</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4</td>\n",
              "      <td>Female</td>\n",
              "      <td>23</td>\n",
              "      <td>16</td>\n",
              "      <td>77</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>5</td>\n",
              "      <td>Female</td>\n",
              "      <td>31</td>\n",
              "      <td>17</td>\n",
              "      <td>40</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   CustomerID   Genre  Age  Income  Score\n",
              "0           1    Male   19      15     39\n",
              "1           2    Male   21      15     81\n",
              "2           3  Female   20      16      6\n",
              "3           4  Female   23      16     77\n",
              "4           5  Female   31      17     40"
            ]
          },
          "execution_count": 11,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "data.head()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 12,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 423
        },
        "id": "QeNByqM7nBZg",
        "outputId": "3c036f13-0ec0-49c6-9610-7637e56741d7"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>CustomerID</th>\n",
              "      <th>Genre</th>\n",
              "      <th>Age</th>\n",
              "      <th>Income</th>\n",
              "      <th>Score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>156</th>\n",
              "      <td>157</td>\n",
              "      <td>Male</td>\n",
              "      <td>37</td>\n",
              "      <td>78</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>158</th>\n",
              "      <td>159</td>\n",
              "      <td>Male</td>\n",
              "      <td>34</td>\n",
              "      <td>78</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>9</td>\n",
              "      <td>Male</td>\n",
              "      <td>64</td>\n",
              "      <td>19</td>\n",
              "      <td>3</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>30</th>\n",
              "      <td>31</td>\n",
              "      <td>Male</td>\n",
              "      <td>60</td>\n",
              "      <td>30</td>\n",
              "      <td>4</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>32</th>\n",
              "      <td>33</td>\n",
              "      <td>Male</td>\n",
              "      <td>53</td>\n",
              "      <td>33</td>\n",
              "      <td>4</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>167</th>\n",
              "      <td>168</td>\n",
              "      <td>Female</td>\n",
              "      <td>33</td>\n",
              "      <td>86</td>\n",
              "      <td>95</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>185</th>\n",
              "      <td>186</td>\n",
              "      <td>Male</td>\n",
              "      <td>30</td>\n",
              "      <td>99</td>\n",
              "      <td>97</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>145</th>\n",
              "      <td>146</td>\n",
              "      <td>Male</td>\n",
              "      <td>28</td>\n",
              "      <td>77</td>\n",
              "      <td>97</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>20</td>\n",
              "      <td>Female</td>\n",
              "      <td>35</td>\n",
              "      <td>23</td>\n",
              "      <td>98</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>12</td>\n",
              "      <td>Female</td>\n",
              "      <td>35</td>\n",
              "      <td>19</td>\n",
              "      <td>99</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>200 rows × 5 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "     CustomerID   Genre  Age  Income  Score\n",
              "156         157    Male   37      78      1\n",
              "158         159    Male   34      78      1\n",
              "8             9    Male   64      19      3\n",
              "30           31    Male   60      30      4\n",
              "32           33    Male   53      33      4\n",
              "..          ...     ...  ...     ...    ...\n",
              "167         168  Female   33      86     95\n",
              "185         186    Male   30      99     97\n",
              "145         146    Male   28      77     97\n",
              "19           20  Female   35      23     98\n",
              "11           12  Female   35      19     99\n",
              "\n",
              "[200 rows x 5 columns]"
            ]
          },
          "execution_count": 12,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "data.sort_values('Score', ascending=True)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 13,
      "metadata": {
        "id": "SZXxqwHi6JF6"
      },
      "outputs": [],
      "source": [
        "# сразу сделаем небольшое преобразование - переведём пол из строк в числа\n",
        "# это нужно для корректной работы моделей,\n",
        "# т.к. они могут обрабатывать только числовые данные\n",
        "data.Genre = data.Genre.apply(lambda x: 0 if x == 'Male' else 1)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "GLyHmHKzQwMN"
      },
      "source": [
        "### Процесс создания, обучения модели и получение результатов\n",
        "\n",
        "Прежде чем алгоритм сможет давать нам какие-либо предсказания, его нужно \"научить\" их делать - для этого модель в прямом смысле обучают: показывают ей некоторые объекты (их характеристики) и правильные ответы для них.\n",
        "\n",
        "Также мы хотим понимать, насколько хорошо работает наш алгоритм - для этого нужен ещё один набор данных с правильными ответами, на которых мы бы уже не обучали алгоритм, но проверяли качество его работы.\n",
        "\n",
        "Поэтому, нам нужно разделить весь набор данных на два набора:\n",
        "- Тренировочный набор, на котором мы собираемся тренировать модель\n",
        "- Тестовый набор, на котором мы будем тестировать нашу модель, чтобы увидеть, насколько точны ее прогнозы\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 14,
      "metadata": {
        "collapsed": true,
        "id": "54GqQ7zh9N8h"
      },
      "outputs": [],
      "source": [
        "# выделим для удобства таргет и признаки\n",
        "X = data.drop('Score', axis = 1) # характеристики\n",
        "y = data.Score # таргеты (правильные ответы)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 15,
      "metadata": {
        "collapsed": true,
        "id": "9dhbIq6o9OAS"
      },
      "outputs": [],
      "source": [
        "# делим на данные для обучения и для теста\n",
        "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ngUfYoXsPgR1"
      },
      "source": [
        "Код и алгоритмы большинства известных моделей уже реализованы в библиотеках Python. Можно составить определённую последовательность команд для прохода по всем \"жизненным циклам\" модели:\n",
        "\n",
        "1. Создание: здесь просто пишем нужное название\n",
        "2. Обучение: при помощи метода fit, в аргумент подаются обучающие данные\n",
        "3. Получение предсказаний: метод predict, в аргументе также подаются данные, на которых мы хотим получить поредсказания обученной модели\n",
        "4. Оценка: существуют различные меткрики для оценки моделей, прописывается также название метода и в аргументы подаются истинные значения и предсказанные.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 16,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "OZVu0Pfk9OHL",
        "outputId": "ef8f0f65-791d-4896-d2fc-c7205aaf17e3"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "The model performance for testing set\n",
            "--------------------------------------\n",
            "Root Mean Squared Error: 22.4644898676879\n"
          ]
        }
      ],
      "source": [
        "# пример схемы выше\n",
        "reg = LinearRegression() # 1\n",
        "reg.fit(X_train, y_train) # 2\n",
        "y_pred = reg.predict(X_test) # 3\n",
        "rmse = (np.sqrt(metrics.mean_squared_error(y_test, y_pred))) # 4\n",
        "\n",
        "print(f\"The model performance for testing set\") # красивая печать на экран :)\n",
        "print(f\"--------------------------------------\")\n",
        "print(f\"Root Mean Squared Error: {rmse}\")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "zLYykfA3YJkS"
      },
      "source": [
        "Алгоритмы нейронных сетей более сложные и используют больше параметров, требуют больше места, памяти и ресурсов для работы. В остальном с точки зрения написания кода алгоритм тот же самый: создаём модель -> обучаем -> предсказываем и оцениваем."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "aKcmeGTSRJ7w"
      },
      "source": [
        "### ⛳ Домашнее задание\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "SlaQhMUWb0gN"
      },
      "source": [
        "✅ Задание 1:  Назовите число колонок в файле"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 17,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "Kz6ATRbg2WNn",
        "outputId": "d4dd068d-37e5-4187-b06b-181fcc64c61e"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "5"
            ]
          },
          "execution_count": 17,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "data.shape[1]"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ob2Q8G0R2fLv"
      },
      "source": [
        "✅ Задание 2:  Назовите имя самой первой колонки"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 18,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "id": "-AvflHRs2fe-",
        "outputId": "0d009a79-a2e2-4476-c6a8-ac7f43237249"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "'CustomerID'"
            ]
          },
          "execution_count": 18,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "data.columns[0]"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "yf0lGLHk2fss"
      },
      "source": [
        "✅ Задание 3:  Найдите самую масимальную оценку от пользователя"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 19,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "cBSLfTqH2f-3",
        "outputId": "94ae0f4e-ff13-4230-fd39-254150ffbbbf"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "99"
            ]
          },
          "execution_count": 19,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "data['Score'].max()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Wi0ujbma2gMh"
      },
      "source": [
        "✅ Задание 4*: Проверьте, есть ли в данных дубликаты, в ответ напишите \"да\" или \"нет\"\n",
        "\n",
        "Подсказка: попробуйте использовать метод drop_duplicates"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 20,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "EdlXAsSZ2gb2",
        "outputId": "1831cdeb-016d-4935-8317-699742a0163d"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "нет\n"
          ]
        }
      ],
      "source": [
        "new_data = data.drop_duplicates()\n",
        "if new_data.shape[0] == data.shape[0]:\n",
        "  print('нет')\n",
        "else:\n",
        "  print('да')"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ihjeCbQ3dkAV"
      },
      "source": [
        "✅ Задание 5: Попробуйте найти в документации ещё какие-нибудь модели из sklearn, и по аналогии с последней ячейкой обучить их на наших данных. Количество моделей неограничено:) В качестве итога можете посчитать метрику score и выбрать наилучшую модель.\n",
        "\n",
        "Подсказка: можно поменять только название модели в первой строке, весь остальной код будет аналогичным."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 21,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "8B36sKBW4O-F",
        "outputId": "382ef046-a7ba-49d8-e352-6d942d5da27c"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "The model performance for testing set\n",
            "--------------------------------------\n",
            "Root Mean Squared Error: 22.28371990465689\n"
          ]
        }
      ],
      "source": [
        "from sklearn import datasets\n",
        "import matplotlib.pyplot as plt\n",
        "\n",
        "from sklearn import linear_model\n",
        "reg2 = linear_model.TheilSenRegressor()\n",
        "\n",
        "reg2.fit(X_train, y_train) # 2\n",
        "y_pred2 = reg2.predict(X_test) # 3\n",
        "\n",
        "rmse2 = (np.sqrt(metrics.mean_squared_error(y_test, y_pred2))) # 4\n",
        "\n",
        "print(f\"The model performance for testing set\") # красивая печать на экран :)\n",
        "print(f\"--------------------------------------\")\n",
        "print(f\"Root Mean Squared Error: {rmse2}\")\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "7muXgYCQe3on"
      },
      "source": [
        "✅ Задание 6*: Попробуйте сделать предсказание на своих собственных данных. Можете воспользоваться приведённым шаблоном"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 24,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "I1m4210C4P3W",
        "outputId": "c725958e-47ee-40e1-f838-c288b1bddcc5"
      },
      "outputs": [
        {
          "ename": "FileNotFoundError",
          "evalue": "[Errno 2] No such file or directory: '/home/itshark/Programming/Sources/Python/DataScience/content/train.csv'",
          "output_type": "error",
          "traceback": [
            "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
            "\u001b[0;31mFileNotFoundError\u001b[0m                         Traceback (most recent call last)",
            "\u001b[1;32m/home/itshark/Programming/Sources/Python/DataScience/Копия_блокнота_\"Погружение_в_DS,_день_2_v3_ipynb\".ipynb Cell 42\u001b[0m line \u001b[0;36m1\n\u001b[1;32m      <a href='vscode-notebook-cell:/home/itshark/Programming/Sources/Python/DataScience/%D0%9A%D0%BE%D0%BF%D0%B8%D1%8F_%D0%B1%D0%BB%D0%BE%D0%BA%D0%BD%D0%BE%D1%82%D0%B0_%22%D0%9F%D0%BE%D0%B3%D1%80%D1%83%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B2_DS%2C_%D0%B4%D0%B5%D0%BD%D1%8C_2_v3_ipynb%22.ipynb#X56sZmlsZQ%3D%3D?line=8'>9</a>\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39msklearn\u001b[39;00m \u001b[39mimport\u001b[39;00m metrics\n\u001b[1;32m     <a href='vscode-notebook-cell:/home/itshark/Programming/Sources/Python/DataScience/%D0%9A%D0%BE%D0%BF%D0%B8%D1%8F_%D0%B1%D0%BB%D0%BE%D0%BA%D0%BD%D0%BE%D1%82%D0%B0_%22%D0%9F%D0%BE%D0%B3%D1%80%D1%83%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B2_DS%2C_%D0%B4%D0%B5%D0%BD%D1%8C_2_v3_ipynb%22.ipynb#X56sZmlsZQ%3D%3D?line=10'>11</a>\u001b[0m \u001b[39m# благодаря интенсиву посмотрела немножко сайт Kaggle и нашла там\u001b[39;00m\n\u001b[0;32m---> <a href='vscode-notebook-cell:/home/itshark/Programming/Sources/Python/DataScience/%D0%9A%D0%BE%D0%BF%D0%B8%D1%8F_%D0%B1%D0%BB%D0%BE%D0%BA%D0%BD%D0%BE%D1%82%D0%B0_%22%D0%9F%D0%BE%D0%B3%D1%80%D1%83%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B2_DS%2C_%D0%B4%D0%B5%D0%BD%D1%8C_2_v3_ipynb%22.ipynb#X56sZmlsZQ%3D%3D?line=11'>12</a>\u001b[0m data_new \u001b[39m=\u001b[39m pd\u001b[39m.\u001b[39;49mread_csv(\n\u001b[1;32m     <a href='vscode-notebook-cell:/home/itshark/Programming/Sources/Python/DataScience/%D0%9A%D0%BE%D0%BF%D0%B8%D1%8F_%D0%B1%D0%BB%D0%BE%D0%BA%D0%BD%D0%BE%D1%82%D0%B0_%22%D0%9F%D0%BE%D0%B3%D1%80%D1%83%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B2_DS%2C_%D0%B4%D0%B5%D0%BD%D1%8C_2_v3_ipynb%22.ipynb#X56sZmlsZQ%3D%3D?line=12'>13</a>\u001b[0m     \u001b[39m\"\u001b[39;49m\u001b[39m/home/itshark/Programming/Sources/Python/DataScience/content/train.csv\u001b[39;49m\u001b[39m\"\u001b[39;49m, sep\u001b[39m=\u001b[39;49m\u001b[39m'\u001b[39;49m\u001b[39m,\u001b[39;49m\u001b[39m'\u001b[39;49m)\n\u001b[1;32m     <a href='vscode-notebook-cell:/home/itshark/Programming/Sources/Python/DataScience/%D0%9A%D0%BE%D0%BF%D0%B8%D1%8F_%D0%B1%D0%BB%D0%BE%D0%BA%D0%BD%D0%BE%D1%82%D0%B0_%22%D0%9F%D0%BE%D0%B3%D1%80%D1%83%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B2_DS%2C_%D0%B4%D0%B5%D0%BD%D1%8C_2_v3_ipynb%22.ipynb#X56sZmlsZQ%3D%3D?line=13'>14</a>\u001b[0m                                                \u001b[39m# кейс с Титаником, оттуда же и взяла данные\u001b[39;00m\n\u001b[1;32m     <a href='vscode-notebook-cell:/home/itshark/Programming/Sources/Python/DataScience/%D0%9A%D0%BE%D0%BF%D0%B8%D1%8F_%D0%B1%D0%BB%D0%BE%D0%BA%D0%BD%D0%BE%D1%82%D0%B0_%22%D0%9F%D0%BE%D0%B3%D1%80%D1%83%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B2_DS%2C_%D0%B4%D0%B5%D0%BD%D1%8C_2_v3_ipynb%22.ipynb#X56sZmlsZQ%3D%3D?line=14'>15</a>\u001b[0m data_new\u001b[39m.\u001b[39mSex \u001b[39m=\u001b[39m data_new\u001b[39m.\u001b[39mSex\u001b[39m.\u001b[39mapply(\u001b[39mlambda\u001b[39;00m x: \u001b[39m0\u001b[39m \u001b[39mif\u001b[39;00m x \u001b[39m==\u001b[39m \u001b[39m'\u001b[39m\u001b[39mmale\u001b[39m\u001b[39m'\u001b[39m \u001b[39melse\u001b[39;00m \u001b[39m1\u001b[39m)\n",
            "File \u001b[0;32m~/.local/lib/python3.11/site-packages/pandas/io/parsers/readers.py:948\u001b[0m, in \u001b[0;36mread_csv\u001b[0;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, date_format, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options, dtype_backend)\u001b[0m\n\u001b[1;32m    935\u001b[0m kwds_defaults \u001b[39m=\u001b[39m _refine_defaults_read(\n\u001b[1;32m    936\u001b[0m     dialect,\n\u001b[1;32m    937\u001b[0m     delimiter,\n\u001b[0;32m   (...)\u001b[0m\n\u001b[1;32m    944\u001b[0m     dtype_backend\u001b[39m=\u001b[39mdtype_backend,\n\u001b[1;32m    945\u001b[0m )\n\u001b[1;32m    946\u001b[0m kwds\u001b[39m.\u001b[39mupdate(kwds_defaults)\n\u001b[0;32m--> 948\u001b[0m \u001b[39mreturn\u001b[39;00m _read(filepath_or_buffer, kwds)\n",
            "File \u001b[0;32m~/.local/lib/python3.11/site-packages/pandas/io/parsers/readers.py:611\u001b[0m, in \u001b[0;36m_read\u001b[0;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[1;32m    608\u001b[0m _validate_names(kwds\u001b[39m.\u001b[39mget(\u001b[39m\"\u001b[39m\u001b[39mnames\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39mNone\u001b[39;00m))\n\u001b[1;32m    610\u001b[0m \u001b[39m# Create the parser.\u001b[39;00m\n\u001b[0;32m--> 611\u001b[0m parser \u001b[39m=\u001b[39m TextFileReader(filepath_or_buffer, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwds)\n\u001b[1;32m    613\u001b[0m \u001b[39mif\u001b[39;00m chunksize \u001b[39mor\u001b[39;00m iterator:\n\u001b[1;32m    614\u001b[0m     \u001b[39mreturn\u001b[39;00m parser\n",
            "File \u001b[0;32m~/.local/lib/python3.11/site-packages/pandas/io/parsers/readers.py:1448\u001b[0m, in \u001b[0;36mTextFileReader.__init__\u001b[0;34m(self, f, engine, **kwds)\u001b[0m\n\u001b[1;32m   1445\u001b[0m     \u001b[39mself\u001b[39m\u001b[39m.\u001b[39moptions[\u001b[39m\"\u001b[39m\u001b[39mhas_index_names\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m=\u001b[39m kwds[\u001b[39m\"\u001b[39m\u001b[39mhas_index_names\u001b[39m\u001b[39m\"\u001b[39m]\n\u001b[1;32m   1447\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhandles: IOHandles \u001b[39m|\u001b[39m \u001b[39mNone\u001b[39;00m \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m\n\u001b[0;32m-> 1448\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_engine \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_make_engine(f, \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mengine)\n",
            "File \u001b[0;32m~/.local/lib/python3.11/site-packages/pandas/io/parsers/readers.py:1705\u001b[0m, in \u001b[0;36mTextFileReader._make_engine\u001b[0;34m(self, f, engine)\u001b[0m\n\u001b[1;32m   1703\u001b[0m     \u001b[39mif\u001b[39;00m \u001b[39m\"\u001b[39m\u001b[39mb\u001b[39m\u001b[39m\"\u001b[39m \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m mode:\n\u001b[1;32m   1704\u001b[0m         mode \u001b[39m+\u001b[39m\u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mb\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m-> 1705\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhandles \u001b[39m=\u001b[39m get_handle(\n\u001b[1;32m   1706\u001b[0m     f,\n\u001b[1;32m   1707\u001b[0m     mode,\n\u001b[1;32m   1708\u001b[0m     encoding\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mencoding\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mNone\u001b[39;49;00m),\n\u001b[1;32m   1709\u001b[0m     compression\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mcompression\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mNone\u001b[39;49;00m),\n\u001b[1;32m   1710\u001b[0m     memory_map\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mmemory_map\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mFalse\u001b[39;49;00m),\n\u001b[1;32m   1711\u001b[0m     is_text\u001b[39m=\u001b[39;49mis_text,\n\u001b[1;32m   1712\u001b[0m     errors\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mencoding_errors\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39m\"\u001b[39;49m\u001b[39mstrict\u001b[39;49m\u001b[39m\"\u001b[39;49m),\n\u001b[1;32m   1713\u001b[0m     storage_options\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mstorage_options\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mNone\u001b[39;49;00m),\n\u001b[1;32m   1714\u001b[0m )\n\u001b[1;32m   1715\u001b[0m \u001b[39massert\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhandles \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m\n\u001b[1;32m   1716\u001b[0m f \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhandles\u001b[39m.\u001b[39mhandle\n",
            "File \u001b[0;32m~/.local/lib/python3.11/site-packages/pandas/io/common.py:863\u001b[0m, in \u001b[0;36mget_handle\u001b[0;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)\u001b[0m\n\u001b[1;32m    858\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(handle, \u001b[39mstr\u001b[39m):\n\u001b[1;32m    859\u001b[0m     \u001b[39m# Check whether the filename is to be opened in binary mode.\u001b[39;00m\n\u001b[1;32m    860\u001b[0m     \u001b[39m# Binary mode does not support 'encoding' and 'newline'.\u001b[39;00m\n\u001b[1;32m    861\u001b[0m     \u001b[39mif\u001b[39;00m ioargs\u001b[39m.\u001b[39mencoding \u001b[39mand\u001b[39;00m \u001b[39m\"\u001b[39m\u001b[39mb\u001b[39m\u001b[39m\"\u001b[39m \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m ioargs\u001b[39m.\u001b[39mmode:\n\u001b[1;32m    862\u001b[0m         \u001b[39m# Encoding\u001b[39;00m\n\u001b[0;32m--> 863\u001b[0m         handle \u001b[39m=\u001b[39m \u001b[39mopen\u001b[39;49m(\n\u001b[1;32m    864\u001b[0m             handle,\n\u001b[1;32m    865\u001b[0m             ioargs\u001b[39m.\u001b[39;49mmode,\n\u001b[1;32m    866\u001b[0m             encoding\u001b[39m=\u001b[39;49mioargs\u001b[39m.\u001b[39;49mencoding,\n\u001b[1;32m    867\u001b[0m             errors\u001b[39m=\u001b[39;49merrors,\n\u001b[1;32m    868\u001b[0m             newline\u001b[39m=\u001b[39;49m\u001b[39m\"\u001b[39;49m\u001b[39m\"\u001b[39;49m,\n\u001b[1;32m    869\u001b[0m         )\n\u001b[1;32m    870\u001b[0m     \u001b[39melse\u001b[39;00m:\n\u001b[1;32m    871\u001b[0m         \u001b[39m# Binary mode\u001b[39;00m\n\u001b[1;32m    872\u001b[0m         handle \u001b[39m=\u001b[39m \u001b[39mopen\u001b[39m(handle, ioargs\u001b[39m.\u001b[39mmode)\n",
            "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/home/itshark/Programming/Sources/Python/DataScience/content/train.csv'"
          ]
        }
      ],
      "source": [
        "import numpy as np      #решила вместо задания с введением своих данных выполнить немножко другое, посложнее, чтобы потренировать свои навыки\n",
        "                        #по аналогии с примером решила попробовать загрузить другую таблицу с данными и попрактиковаться\n",
        "                        #с обучением сетки предсказывать одну из колонок таблицы\n",
        "import pandas as pd\n",
        "from sklearn import datasets\n",
        "\n",
        "from sklearn.model_selection import train_test_split\n",
        "from sklearn.ensemble import HistGradientBoostingClassifier\n",
        "from sklearn import metrics\n",
        "\n",
        "# благодаря интенсиву посмотрела немножко сайт Kaggle и нашла там\n",
        "data_new = pd.read_csv(\n",
        "    \"/home/itshark/Programming/Sources/Python/DataScience/content/train.csv\", sep=',')\n",
        "                                               # кейс с Титаником, оттуда же и взяла данные\n",
        "data_new.Sex = data_new.Sex.apply(lambda x: 0 if x == 'male' else 1)\n",
        "data_new['Embarked'] = data_new['Embarked'].replace(['C', 'S', 'Q'], [0, 1, 2])\n",
        "del data_new['Name']               #убрала те колонки, которые посчитала не совсем релевантными исследованию\n",
        "del data_new['Ticket']\n",
        "del data_new['Cabin']\n",
        "x = data_new.drop('Survived', axis = 1)\n",
        "y = data_new.Survived\n",
        "\n",
        "x_trains, x_tests, y_trains, y_tests = train_test_split(x, y, test_size=0.2, random_state=42)\n",
        "\n",
        "reg = HistGradientBoostingClassifier() # сначала хотела взять другую модель, но из-за обработки\n",
        "reg.fit(x_trains, y_trains)            # программа предложила мне попробовать эту модель\n",
        "y_predict = reg.predict(x_tests)\n",
        "\n",
        "rmse_new = (np.sqrt(metrics.mean_squared_error(y_tests, y_predict)))\n",
        "\n",
        "my_data = np.array([892, 3, 1, 23, 0, 0, 8, 1]) #теперь вернулась к изначальному заданию и попробовала предсказать, выжила ли бы я\n",
        "                                                #спойлер: (увы, нет)\n",
        "y_my = reg.predict(my_data.reshape(1, -1))\n",
        "print(y_my)\n",
        "\n",
        "print(f\"The model performance for testing set\")\n",
        "print(f\"--------------------------------------\")\n",
        "print(f\"Root Mean Squared Error: {rmse_new}\")\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "PNwIroOH86R7"
      },
      "source": [
        "PS: Можете подумать, какая колонка является неинформативной с точки зрения обучения (соответственно, её можно удалить:))\n",
        "\n",
        "# 🌟 Удачи!\n",
        "Фидбеки по каждой работе напишем в телеграм-чате\n",
        "\n"
      ]
    }
  ],
  "metadata": {
    "colab": {
      "include_colab_link": true,
      "provenance": []
    },
    "gpuClass": "standard",
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.11.5"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
